<template>
  <!--修饰符-->
  <h1> 修饰符</h1>
  <el-input v-model="model" placeholder=""></el-input>
  {{ model }}
</template>

<script setup lang="ts" generic="T">
  import { reactive } from 'vue'
  // const [model, modifiers] = defineModel<T>()

  const [model, modifiers] = defineModel({
    get(value:string) {
      if (modifiers.capitalize) {
        return value.charAt(0).toUpperCase() + value.slice(1)
      }
      return value
    }
  })

  // 修饰符的结构
  console.log('modifiers', modifiers)
  const key1 = Object.keys(modifiers)[0] 

</script>